var form_onBeforeLoad = function(param)
{
    jQuery(this).datagrid('options').url =__EmailQueue_BuildUrl() ;
};

function grid_preinit()
{

}
function __EmailQueue_BuildUrl(){
    var url=__FormHelper_GetActionLink(); 
    var options=__FormHelper_GetGridObject().datagrid("options");
    // for pager
    var search_email=jQuery.trim(jQuery("#serch_email").searchbox("getValue"));
    if(search_email!='')
        {
        url += "&search_email="+search_email;   
    }
    var mail_status = $('#combo_bl').combobox('getValue');
    if(mail_status!="")
        {
        url+="&mail_status="+mail_status;
    }
    var from_date = $('#fd').datetimebox('getValue');
    if(from_date!="")
        {
        url+="&from_date="+from_date;
    }
    var to_date = $('#td').datetimebox('getValue');
    if(to_date!="")
        {
        url+="&to_date="+to_date;
    }
    if (options.sortName != null)
    {
        url+="&sortName="+encodeURI(options.sortName)+"&sortOrder="+options.sortOrder;
    }
    url+="&page="+options.pageNumber+"&pageSize="+options.pageSize;
    
    return url;

}
var form_sysmail_preinit = function(){
    $('#fd').datetimebox({  
        showSeconds:false,
        mulitple: false,
        editable: false
    });
    $('#td').datetimebox({  
        showSeconds:false,
        mulitple: false,
        editable: false
    }); 
    $('#combo_bl').combobox({  
        mulitple: false,
        editable: false,
        panelHeight:100
    });  
}

